package com.davfx.httpnio;

import java.util.HashMap;
import java.util.Map;

public final class HttpRequest {
	
	public static enum Method {
		GET("GET"),
		POST("POST"),
		HEAD("HEAD"),
		PUT("PUT"),
		DELETE("DELETE");
		
		private final String out;
		private Method(String out) {
			this.out = out;
		}
		@Override
		public String toString() {
			return out;
		}
	}

	private final String host;
	private final int port;
	private final Method method;
	private final String path;
	private final Map<String, String> headers;
	private final Map<String, String> parameters;
	
	public HttpRequest(String host, int port, Method method, String path, Map<String, String> headers, Map<String, String> parameters) {
		this.host = host;
		this.port = port;
		this.method = method;
		this.path = path;
		this.headers = headers;
		this.parameters = parameters;
	}
	
	public HttpRequest(String host, int port, Method method, String path) {
		this(host, port, method, path, new HashMap<String, String>(), new HashMap<String, String>());
	}
	
	public String getHost() {
		return host;
	}
	public int getPort() {
		return port;
	}
	public Method getMethod() {
		return method;
	}
	public String getPath() {
		return path;
	}
	public Map<String, String> getHeaders() {
		return headers;
	}
	public Map<String, String> getParameters() {
		return parameters;
	}
}
